
$(function (){

    $("#btngoBack").click(function (){
        window.history.back();
    })

    $("#userListManager").click(function (){
        $("#dataTable").html("");
        $.ajax({
            url: "/admin/usersList"
            ,type: "get"
            ,success:function (res){
                console.log(res)
                let  str=`
            <tr>
                <th>会员ID</th>
                <th>登录名</th>
                <th>会员名</th>
                <th>邮箱</th>
            </tr>`;
                $("#dataTable").append(str)

                for (const obj of res.list) {
                    console.log(obj.loginName)
                    console.log(obj.realName)
                    str =`
                    <tr>
                        <td>`+obj.id+`</td>
                        <td>`+obj.loginName+`</td>
                        <td>`+obj.realName+`</td>
                        <td>`+obj.email+`</td>
                    </tr>
                    `
                    $("#dataTable").append(str)
                }
                console.log(str)
            }
        })
    })
})